package com.caochenlei.stack;

public class StackTest {
    public static void main(String[] args) {
        Stack<String> stack = new Stack<>(4);

        System.out.println("==========第一块输出内容：开始==========");
        System.out.println(stack);
        stack.push("张三");
        stack.push("李四");
        stack.push("王五");
        System.out.println(stack);
        System.out.println("==========第一块输出内容：结束==========");
        System.out.println();

        System.out.println("==========第二块输出内容：开始==========");
        System.out.println(stack.peek());
        System.out.println("==========第二块输出内容：结束==========");
        System.out.println();

        System.out.println("==========第三块输出内容：开始==========");
        System.out.println(stack);
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack);
        System.out.println("==========第三块输出内容：结束==========");
    }
}
